//
//  NSDate+Date.m
//  XYuanTiKu
//
//  Created by mayanwei on 15-8-6.
//  Copyright (c) 2015年 XiongYing Tec. All rights reserved.
//

#import "NSDate+Date.h"

@implementation NSDate (Date)

+ (NSDate *)transformTime:(NSString *)time
{
    if ([time hasSuffix:@".0"]) {
        time = [time stringByReplacingOccurrencesOfString:@".0" withString:@""];
    }
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
    NSDate *destDate = [dateFormatter dateFromString:time];
    return destDate;
}

@end
